package me.sdau.spider.openapi.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CreationTimestamp;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

@Data
@Entity
@Builder
@Table(name = "t_api_user")
@NoArgsConstructor
@AllArgsConstructor
public class User implements Serializable {
    private static final long serialVersionUID = 7443232072197310367L;
    @Id
    @GeneratedValue
    private Long id;
    /** 账户*/
    @Column(unique = true)
    private String account;
    /** */
    private String appkey;
    /** 有效期*/
    @Temporal(TemporalType.DATE)
    private Date validityDate;
    /** 接口 URL*/
    private String api;

    /** 创建时间*/
    @CreationTimestamp
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
    /** 最后登录时间 */
    @Temporal(TemporalType.TIMESTAMP)
    private Date LoginTime;
    /** 最后登录 IP*/
    private String LoginIp;
    /** 盐*/
    private String salt;
}
